<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>轮播图</title>
	</head>
	<body>
		<img src="img/mei1.jpg" id="tu" width="100%"">
		<script>
		var n=1;
		function fun(){
			n++;
			if(n>3){
				n=1;
			}
			//获取元素对象
			var tu=document.getElementById("tu");
			//修改元素值
			tu.src="img/mei"+n+".jpg";
		}
		setInterval(fun,200);
		</script>
		<h3>乐乐制作</h3>
	</body>
</html>